home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 981 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.4 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: clamage@Eng.Sun.COM (Steve Clamage)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: static members as members of a metacla
  5. Date: 06 Apr 1996 11:33:17 PST
  6. Organization: Sun Microsystems Inc., Mountain View, CA
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4k2bv4$32p@engnews1.Eng.Sun.COM>
  9. References: <KANZE.96Mar29114545@gabi.gabi-soft.fr> <4jp7st$lbj@engnews1.Eng.Sun.COM> <KANZE.96Apr4133331@gabi.gabi-soft.fr>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 5 Apr 1996 05:44:04 GMT
  12. X-Newsreader: NN version 6.5.0 #21 (NOV)
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMWbG/ky4NqrwXLNJAQGqkgIAwXEVtGpJXPSNhtAN/S2RqincRRYF2kt/
  15.     avSsNKFZ6jUm21bS2xpjhQtI3ktKGXpgA0MQi3BblvpWob7p+Ydr8Q==
  16.     =QGql
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. kanze@gabi-soft.fr (J. Kanze) writes:
  20.  
  21. >But the question concerned static objects in a module that was never
  22. >referenced.  (What I'm thinking of here are objects whose constructor
  23. >registers them with some sort of container, and that are only accessed
  24. >via that container.  If they are constructed, they will be accessed.
  25. >But is there any guarantee that they will eventually be constructed?)
  26.  
  27. I've been trying to use as many weasel-words as possible here, and so I
  28. wish you wouldn't keep pointing out the holes I'm deliberately
  29. leaving unplugged. :-)
  30.  
  31. If a non-local static object is defined in a module, but no reference
  32. is made to anything in that module, I don't believe the static object
  33. is guaranteed to be constructed. If any object or function in that
  34. module is referenced from outside the module, I believe all non-local
  35. static objects are supposed to be constructed.
  36.  
  37. The problem as I see it is the draft standard still makes some promises
  38. which I don't believe are possible to keep in all cases (even
  39. forgetting about dynamic libraries). I don't think we have the final
  40. word on exactly what you can expect about order of initializtion
  41. and destruction of non-local static objects in different modules. The
  42. current situation is that you can't depend on the order of construction
  43. or destruction.
  44.  
  45. --
  46. Steve Clamage, stephen.clamage@eng.sun.com
  47. ---
  48. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  49.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  50.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  51.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  52.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  53. ]
  54.